<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>		
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/style.css">
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.2.1.js">
	</script>
<title>八维贴吧</title>
</head>
<body>
  <!-- 包含header.jsp -->
  <jsp:include page="/WEB-INF/view/common/header.jsp"/>
  
  <!-- ///////////////////////////////自己开发部分中间部分开始/////////////////////////// -->
  <form style="display: none;" id="pageFrm" action="${pageContext.request.contextPath}/topics" method="post">
     <input type="text" id="pageNum" value="${pageInfo.pageNum}" name="pageNum"/>
     <input type="text" name="forum.id" value="${forum.id}"/>
  </form>
  <div class="container">
        <div class="row">
            <div class="col12">
                    <div class="card" style="background-color: white">
                        <div class="card-header">
                            <b>${forum.name}</b>
                        </div>
                        <div class="card-body">
                            <table>
                                <thead>
                                    <tr>
                                        <th width="60%">贴子</th>
                                        <th width="15%">作者</th>
                                        <th width="18%">最新回复时间</th>
                                        <th width="7%">总回复</th>
                                    </tr>
                                </thead>
                                
                                    <tbody>
                                    <c:forEach var="topic" items="${pageInfo.list}">
                                    <tr>
                                        <td><a href="${pageContext.request.contextPath}/my/topicRelpy?id=${topic.id}">${topic.title }</a></td>
                                        <td align="center">${topic.user==null?'':topic.user.userName }</td>
                                        <td align="center">
                                        <fmt:formatDate value="${topic.replyTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
                                        </td>
                                        <td align="center">${topic.floors }</td>
                                    </tr>
                                
                                </c:forEach>
                                
                            </tbody></table>
                            <p align="center">
                               <jsp:include page="/WEB-INF/view/page/page_num.jsp"/>
                            </p>
                        </div>
                    </div>
            </div>
        </div>
    </div>
  
  
  
  
  <!-- ///////////////////////////////自己开发部分中间部分开始/////////////////////////// -->
  
  <!-- jsp包含尾部footer.jsp -->
  <jsp:include page="/WEB-INF/view/common/footer.jsp"/>
  
  <script type="text/javascript">
    function searchData(pageNum){
        $("#pageNum").val(pageNum);
        $("#pageFrm").submit();
     }

  </script>
  
</body>
</html>